﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web;

namespace Model
{

    [MetadataType(typeof(Customer_Metadata))]
    [DisplayName("Customer")]
    public partial class Customer
    {
        public Customer()
        {
            this.Id = Guid.NewGuid();
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
            this.AddDate = DateTime.Now;
            this.Email = "@";
            this.Site = "http://";
        }

        public class Customer_Metadata
        {
            [ScaffoldColumn(false)]
            public Guid Id { get; set; }

            [ScaffoldColumn(false)]
            public Guid UserId { get; set; }

            [DisplayName("添加日期")]
            [Required]
            public object AddDate { get; set; }

            [DisplayName("客户名称")]
            [Required]
            public object CustomerName { get; set; }

            [DisplayName("电话")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Phone { get; set; }

            [DisplayName("传真")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Fax { get; set; }

            [DisplayName("E-mail")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Email { get; set; }

            [DisplayName("网址")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Site { get; set; }

            [DisplayName("联系地址")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Addresses { get; set; }
            [DisplayName("等级")]
            [Required]
            public object Level { get; set; }

            [DisplayName("备注")]
            [DataType(DataType.MultilineText)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Note { get; set; }

        }
    }
}
